<%@ page import="day03.Emp" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        pageContext.setAttribute("message","pageContext Hello");
        request.setAttribute("message","request Hello");
        session.setAttribute("message","session Hello");
        application.setAttribute("message","application Hello");

        Emp emp=new Emp();
        emp.setName("abc");
        emp.setHobbies(new String[]{"1","3"});
        request.setAttribute("emp",emp);

        Map map=new HashMap();
        map.put("name","aaa");
        map.put("age",21);
        request.setAttribute("map",map);

        List list=new ArrayList();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        request.setAttribute("list",list);
    %>

    <%
        String message= (String) request.getAttribute("message");
        if(message!=null){
            out.print(message);
        }
    %><br/>

    ${message}<br/>

    ${pageScope.message}<br/>
    ${requestScope.message}<br/>
    ${sessionScope.message}<br/>
    ${applicationScope.message}<br/>

    ${emp.name}<br/>
    ${emp["name"]}<br/>
    ${emp.hob}<br/>

    ${pageContext.request.contextPath}<br/>

    ${map.name}<br/>
    ${map["age"]}<br/>

    ${list[1]}<br/>

    ${emp.name.toUpperCase()}<br/>
    ${list.get(1)}<br/>

    ${Math.random()}<br/>
    ${Math.PI}<br/>

    ${1+1}<br/>
    ${1==2}<br/>
    ${1>5?"aaa":"bbb"}<br/>
    ${"aaa".equals("bbb")}<br/>
    ${"aaa" eq "bbb"}<br/>
    ${"aaa" ne "bbb"}<br/>
    ${empty user}<br/>

    ${param.username}<br/>

    ${header["User-Agent"]}<br/>

    ${cookie.username}<br/>
    ${cookie.username.name}<br/>
    ${cookie.username.value}<br/>

</body>
</html>
